package com.fenxiangle.yueding.feature.mine.view.adapter;

import android.support.annotation.Nullable;
import android.widget.RelativeLayout;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.fenxiangle.yueding.R;
import com.fenxiangle.yueding.entity.bo.GenreClassBo;

import java.util.List;

/**
 * Created by Home on 2018/9/2.
 */

public class RequirementGenreClassAdapter extends BaseQuickAdapter<GenreClassBo,BaseViewHolder> {
    private int selectItem;
    public RequirementGenreClassAdapter(int layoutResId, @Nullable List<GenreClassBo> data) {
        super(R.layout.item_class, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, GenreClassBo item) {
        RelativeLayout layout_send= helper.getView(R.id.layout_class);
        if(getSelectItem()==helper.getAdapterPosition()){
            layout_send.setSelected(true);
        }else{
            layout_send.setSelected(false);
        }
        helper.setText(R.id.item_class_name,item.getText());
    }


    public int getSelectItem() {
        return selectItem;
    }

    public void setSelectItem(int selectItem) {
        this.selectItem = selectItem;
    }
}
